package com.lsa.other;

import junit.framework.TestCase;

public class TestPathAbsolutizer extends TestCase
{
	public void test()
	{
		assertEquals("/dev/hda1", PathAbsolutizer.getAbsolutePath("/dev/hda1"));
		
		String expected = "/mnt/hda5/Lapukhov/MyDocs/programming/algorithms/theory";
		String test = "/mnt/hda5/Lapukhov/MyDocs/programming/algorithms/theory";
		assertEquals(expected, PathAbsolutizer.getAbsolutePath(test));
		
		expected = "/mnt/hda5/Lapukhov/MyDocs/programming/algorithms/theory";
		test = "/mnt/hda5/Lapukhov/../Lapukhov/MyDocs/./programming/algorithms/theory";
		assertEquals(expected, PathAbsolutizer.getAbsolutePath(test));
		
		test = "/mnt/hda5/Lapukhov/../Lapukhov/MyDocs/../../Lapukhov/MyDocs/programming/algorithms/";
		expected = "/mnt/hda5/Lapukhov/MyDocs/programming/algorithms";
		assertEquals(expected, PathAbsolutizer.getAbsolutePath(test));
	}
}
